/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  /**
   * 登录
   */
  router.post('/login', controller.admin.login);
  router.post('/reg', controller.admin.registry);
  router.get('/me', controller.admin.me);

  /**
   * 用户管理
   */
  router.post('/user/add', controller.user.addUser);
  router.post('/user/del', controller.user.delUser);
  router.post('/user/update', controller.user.updateUser);
  router.get('/user/get', controller.user.getUser);

  /**
   * 标签管理
   */
  router.post('/bank/addTag', controller.bank.addTag);
  router.post('/bank/updateTag', controller.bank.updateTag);
  router.get('/bank/getTag', controller.bank.getTags);
  router.post('/bank/delTags', controller.bank.delTags);

  /**
   * 题型管理
   */
  router.post('/bank/addQuesType', controller.bank.addQuesType);
  router.post('/bank/updateQuesType', controller.bank.updateQuesType);
  router.get('/bank/getQuseType', controller.bank.getQuseType);
  router.post('/bank/delQuesType', controller.bank.delQuesType);

  /**
   * 题目管理
   */
  router.post('/bank/addQues', controller.bank.addQues);
  router.post('/bank/delQues', controller.bank.delQues);
  router.post('/bank/updateQues', controller.bank.updateQues);
  router.get('/bank/getQues', controller.bank.getQues);

  /**
   * 试卷管理
   */
  router.post('/exam/addTestPaper', controller.exam.addTestPaper);
  router.post('/exam/delTestPaper', controller.exam.delTestPaper);
  router.post('/exam/updateTestPaper', controller.exam.updateTestPaper);
  router.get('/exam/getTestPaper', controller.exam.getTestPaper);

  /**
   * 笔试管理
   */
  router.post('/exam/addExam', controller.exam.addExam);
  router.get('/exam/getExams', controller.exam.getExams);
  router.post('/exam/updateExam', controller.exam.updateExam);
  router.post('/exam/addExamUser', controller.exam.addExamUser);
  router.post('/exam/delExamUsers', controller.exam.delExamUsers);
  router.post('/exam/sendEmail', controller.exam.sendEmail);
  router.post('/exam/delExam', controller.exam.delExam);
  router.post('/exam/updateConfig', controller.exam.updateConfig);
  router.post('/exam/linkExamPaper', controller.exam.linkExamPaper);
  /**
   * 面试管理
   */
  router.post('/meeting/addMeeting', controller.meeting.addMeeting);
  router.get('/meeting/getMeetings', controller.meeting.getMeetings);
  router.post('/meeting/delMeeting', controller.meeting.delMeeting);
  router.post('/meeting/updateMeeting', controller.meeting.updateMeeting);
  router.post('/meeting/addMeetingUsers', controller.meeting.addMeetingUsers);
  router.post('/meeting/delMeetingUsers', controller.meeting.delMeetingUsers);
  router.post('/meeting/sendEmail', controller.meeting.sendEmail);
  router.post('/meeting/updateInterViewTime', controller.meeting.updateInterViewTime);
  router.post('/meeting/sendNoOffer', controller.meeting.sendNoOffer);
  router.post('/meeting/sendOffer', controller.meeting.sendOffer);


  /**
   * 前台获取面试列表
   * @param {string} day - 当前日期
   * @param {string} userId - 面试官id
   */
  router.get('/meeting/getInterView', controller.meeting.getInterView);
  router.post('/meeting/submitEvaluation', controller.meeting.submitEvaluation);
  router.get('/meeting/getEvaluation', controller.meeting.getEvaluation);
  router.get('/meeting/getEvaluations', controller.meeting.getEvaluations);
  router.get('/meeting/getEvaluationById', controller.meeting.getEvaluationById);
  router.get('/meeting/getEvaluationByEid', controller.meeting.getEvaluationByEid);
  /**
   * 面试前台
   */
  router.post('/meeting/uploadjl', controller.meeting.uploadjl);
  router.post('/meeting/accept', controller.meeting.accept);
  router.post('/meeting/getToken', controller.meeting.getToken);
  router.post('/meeting/updateState', controller.meeting.updateState);
  router.get('/meeting/getIsReject', controller.meeting.getIsReject);
  router.get('/meeting/getByToken', controller.meeting.getByToken);
  router.post('/meeting/getInterviewById', controller.meeting.getInterviewById);
  /**
   * 笔试前台
   */
  router.get('/examme', controller.examfront.me);
  router.post('/examgetToken', controller.examfront.getToken);
  router.get('/examfront/get', controller.examfront.getExam);
  router.post('/examfront/uploadSignature', controller.examfront.uploadSignature);
  router.get('/examfront/getExamPaper', controller.examfront.getExamPaper);
  router.post('/examfront/submit', controller.examfront.submitExamPaper);
  router.post('/examfront/checkConfig', controller.examfront.checkConfig);
  router.post('/examfront/begin', controller.examfront.begin);
  router.post('/examfront/sendJumpMsg', controller.examfront.sendJumpMsg);
  router.get('/exam/getNum', controller.exam.getNum);
  /**
   * 设置法务文件
   */
  router.post('/setting/updateDocxFile', controller.setting.updateDocxFile);
  router.get('/setting/getDocxFile', controller.setting.getDocxFile);
};
